{% extends 'web_template/default_one/templates/base.html' %}
{% block title %}{{ tlcms_content.data.title }}{% endblock %}
{% block keywords %}{{ tlcms_content.data.title }},{% for foo in tlcms_content.data.keyword %}{{ foo }},{% endfor %}{% endblock %}
{% block description %}{{ tlcms_content.data.description }}{% endblock %}
{% block content %}
    <div id="main" style="transform: none;">
        <div class="main container" style="transform: none;">
            <div class="main_body" style="transform: none;">
                <div class="main_left main_left_cate">
                    <div class="breadcrumb">
                        <a href="{{ url_for('webapp_bp.index_page') }}" title="{{ public.system.web_name }}">首页</a>
                        <i class="fa fa-angle-right"></i><a href="{{ url_for('webapp_bp.list_article_page',cid=tlcms_content.data.PID_Id) }}"
                                                            title="{{ tlcms_content.data.PID }}">{{ tlcms_content.data.PID }}</a><i
                            class="fa fa-angle-right"></i>正文
                    </div>
                    <div class="post">
                        <div class="article_title">
                            <h1>{{ tlcms_content.data.title }}</h1>
                            <div class="info">
                                <span><i class="fa fa-user-circle-o"></i>{{ tlcms_content.data.author }}</span>
                                <span><i class="fa fa-eye"></i>阅读：{{ tlcms_content.data.clicks }}</span>
                                <span><i class="fa fa-clock-o"></i>{{ tlcms_content.data.update_time }}</span>
                                <span class="comm"><i class="fa fa-comments-o"></i>评论：{{ tlcms_content.comment_total }}</span>
                            </div>
                        </div>
                        <div class="article_content">
                            {{ tlcms_content.data.content|safe }}
                            <p>本文 <a href="http://www.tlcms.net/" target="_blank">TL-CMS 演示站</a> 原创，转载保留链接！网址：<a href="{{ request.url }}" target="_blank" title="{{ tlcms_content.data.title }}">{{ request.url }}</a>
                            </p>
                        </div>
                        <div class="tags_share">
                            <div class="artice_tags">
                                <span>关键词:</span>
                                {% for foo in tlcms_content.data.keyword %}
                                    <a href="{{ url_for('webapp_bp.tag_page',tag=foo) }}" target="_blank">{{ foo }}</a>
                                {% endfor %}
                            </div>
                            <div class="artice_share">
                                <div class="shares">
                                    <div class="bdsharebuttonbox bdshare-button-style0-32" data-bd-bind="1576475160483"><a href="#" class="bds_more"
                                                                                                                           data-cmd="more"></a><a href="#" class="bds_tsina" data-cmd="tsina"
                                                                                                                                                  title="分享到新浪微博"></a><a href="#" class="bds_weixin"
                                                                                                                                                                         data-cmd="weixin"
                                                                                                                                                                         title="分享到微信"></a><a href="#"
                                                                                                                                                                                              class="bds_sqq"
                                                                                                                                                                                              data-cmd="sqq"
                                                                                                                                                                                              title="分享到QQ好友"></a><a
                                            href="#"
                                            class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a></div>
                                    <script>window._bd_share_config = {
                                        "common": {"bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdMiniList": false, "bdPic": "", "bdStyle": "0", "bdSize": "32"},
                                        "share": {}
                                    };
                                    with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];</script>
                                </div>
                            </div>
                        </div>
                        <div class="avow">
                            <div class="avowtitle">声明</div>
                            <!-- 声明 -->
                            <p>1.本站遵循行业规范，任何转载的稿件都会明确标注作者和来源；2.本站的原创文章，请转载时务必注明文章作者和来源，不尊重原创的行为我们将追究责任；3.作者投稿可能会经我们编辑修改或补充。</p>
                            <!-- @声明 -->
                        </div>
                        <div class="related">
                            <div class="md_tit">
                                <span>相关文章</span>
                            </div>
                            <ul>
                                {% for foo in tlcms_content.similar[:8] %}
                                    <li><a href="{{ url_for('webapp_bp.article_page',uid=foo.ID) }}" title="{{ foo.title }}">
                                        <div class="img">
                                            <img src="{{ foo.imgUrl }}" alt="{{ foo.title }}"></div>
                                        <p>{{ foo.title }}</p>
                                    </a>
                                    </li>
                                {% endfor %}
                            </ul>
                        </div>

                        <div id="comments" class="comments">
                            <div class="md_tit">
                                <span>发表评论</span>
                                <i><a rel="nofollow" id="cancel-reply" href="#comments" style="display:none;">取消回复</a></i>
                            </div>

                            <div id="comment_post" class="compost">
                                <div class="cp_avatar">
                                    <img src="{{ 'img/1.jpg'|tl_static }}">
                                </div>
                                <div class="cp_post">
                                    <form id="frmSumbit">
<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>

                                        <div class="cp_info">
                                            <ul>
                                                <li>
                                                    <label for="inpName"></label>
                                                    <input class="ipt" type="text" name="user_name" id="user_name" value="访客" tabindex="2" readonly="readonly">
                                                </li>
                                            </ul>
                                        </div>
                                        <div class="cp_box">
                                            <textarea placeholder="请输入评论内容..." class="textarea" name="comment_txt" id="txaArticle" cols="100%" rows="5" tabindex="1"></textarea>
                                        </div>
                                        <div class="cp_info">
                                            <a id="submit" onclick="comment_post()">提交评论</a>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            {% for foo in tlcms_content.commentList[:50] %}
                             <div class="c_list">
                                <label id="AjaxCommentBegin">来自：{{ foo.user_name }}的评论：</label>
                                <label id="AjaxCommentEnd"> {{ foo.comment_txt }}</label>
                                <label> 【{{ foo.create_time }}】</label>
                            </div>
                            {% endfor %}
                        </div>
                    </div>
                </div>
                <div class="main_right" id="main_right" style="position: relative; overflow: visible; box-sizing: border-box; min-height: 1px;">
                    <div class="theiaStickySidebar">
                        <div class="widget widget_searchpanel">
                            <div class="md_tit"><span>搜索</span></div>
                            <div class="widget_div">
                                <form name="search" method="get" action="{{ url_for('webapp_bp.search') }}">
                                    <input type="text" name="keywords" placeholder="输入关键词">
                                    <button type="submit" class="submit" value="搜索"><i class="fa fa-search"></i></button>
                                </form>
                            </div>
                        </div>
                        <div class="widget widget_paihang">
                            <div class="md_tit"><span>排行榜</span></div>
                            <div class="paihang">
                                <ul class="tit">
                                    <li class="active"><a href="javascript:;" data="hot_1">热门文章</a></li>
                                    <li><a href="javascript:;" data="hot_2">随机文章</a></li>
                                </ul>
                                <div id="hot_1" class="ph_list" style="display: block;">
                                    <ul>
                                        {% for foo in public.click_doc[:9] %}
                                            <li><a href="{{ url_for('webapp_bp.article_page',uid=foo.ID) }}" target="_blank">{{ foo.title[:16] }}{% if foo.title|length>16 %}...{% endif %}</a></li>
                                        {% endfor %}
                                    </ul>
                                </div>

                                <div id="hot_2" class="ph_list" style="display: none;">
                                    <ul>
                                        {% for foo in public.ran_doc[:9] %}
                                            <li><a href="{{ url_for('webapp_bp.article_page',uid=foo.ID) }}" target="_blank">{{ foo.title[:16] }}{% if foo.title|length>16 %}...{% endif %}</a></li>
                                        {% endfor %}
                                    </ul>
                                </div>
                            </div>
                        </div>
                        <div class="widget widget_previous">
                            <div class="md_tit"><span>最近发表</span></div>
                            <ul>
                                {% for foo in public.topNew.data[:9] %}
                                    <li><a href="{{ url_for('webapp_bp.article_page',uid=foo.ID) }}" target="_blank">{{ foo.title[:16] }}{% if foo.title|length>16 %}...{% endif %}</a></li>
                                {% endfor %}
                            </ul>
                        </div>
                        <div class="widget widget_tags">
                            <div class="md_tit"><span>标签列表</span></div>
                            <ul>
                                {% for foo in public.tags[:100] %}
                                    <li class="tagbgc5"><a target="_blank" href="{{ url_for('webapp_bp.tag_page',tag=foo.tag_name) }}">{{ foo.tag_name }}</a></li>
                                {% endfor %}
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>$(function () {
      $('#user_name').attr('value',returnCitySN["cip"]);
    });
    function comment_post() {
          var data = $("#frmSumbit").serializeArray();
        $.ajax({
            url:'/comment_add/{{ tlcms_content.data.ID }}',
            type: 'POST',
            data: data,
            dataType: "json",
            success: function (data) {
                if (data.status === 0) {
                    var html = '<div class="c_list"><label id="AjaxCommentBegin">来自：'+$("#user_name").attr('value')+'的评论：</label><label id="AjaxCommentEnd"> '+document.getElementById("txaArticle").value+'</label><label> 【当前】</label></div>';
                    $('#comment_post').after(html);
                    document.getElementById("txaArticle").value="";
                    alert(data.msg);
                } else {
                    alert(data.msg)
                }
            }, error: function () {
                alert('评论异常！')
            }
    })
      }</script>
{% endblock %}